/**
 * @author huwen
 * 温故而知新
 * @date 2023/12/28 17:24
 */
public class X2 {
    public static void main(String[] args) {
        int sum = 0; // 奇数和
        int evenSum = 0; // 偶数和
        for (int i = 1; i <= 100; i++) {
            if (i % 2 == 1) {
                sum += i;
            }
            if (i % 2 == 0) {
                evenSum += i;
            }
        }
        System.out.println("100以内的奇数和是" + sum);
        System.out.println("100以内的偶数和是" + evenSum);
        System.out.println("100以内的奇偶和是" + (sum + evenSum));
    }
}
